<%@page import="com.callbell.cas.util.ResourceBundleUtil"%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page session="true"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<c:set var="appContextPath" value='<%=ResourceBundleUtil.getProperty("app.web.url")%>' />

<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<title>用户登录</title>
<link type="text/css" rel="stylesheet" href="css/customCss/public.css" />
<link type="text/css" rel="stylesheet" href="css/customCss/login.css" />

<script type="text/javascript" src="js/customJs/jquery-1.11.3.min.js"></script>
<script type="text/javascript" src="js/customJs/function.js"></script>
<script type="text/javascript" src="js/customJs/login.js"></script>
</head>

<body>
	<div class="container">
        <div class="member-logo">
            <a href="javaScript:void(0);">
                <img src="images/langyou/zhuyetubiao.png">
            </a>
        </div>
        <h3 class="member-des">狼友文化,缺你不可</h3>
        <p class="member-category">一个帐号，玩转所有服务！</p>
        <form:form method="post" id="fm1" cssClass="fm-v clearfix" commandName="${commandName}" htmlEscape="true">
        	<div class="input-groups">
	            <div class="input-group">
	            	<form:input id="username" tabindex="1" accesskey="${userNameAccessKey}"  class="linp01 userbg f_left" path="username" autocomplete="false" htmlEscape="true" />
	                <i class="icon-bg icon-input icon-bg-phone"></i>
	                <div class="input-err input-err-phone">
	                    <i class="icon-bg icon-bg-error"></i>
	                    <span class="input-err-text"></span>
	                </div>
	            </div>
	            <div class="input-group">
	                <form:password id="password" class="linp01 passbg f_left" tabindex="2" path="password" accesskey="${passwordAccessKey}" htmlEscape="true" autocomplete="off" />
	                <i class="icon-bg icon-input icon-bg-lock"></i>
	                <div class="input-err input-err-pwd">
	                    <i class="icon-bg icon-bg-error"></i>
	                    <span class="input-err-text"></span>
	                </div>
	            </div>
	            <c:if test="${not empty remainLoginCountForShow}">
					<li style="margin-bottom: 5px">
						<input class="linp02" tabIndex="3" placeholder="验证码" maxlength="4" id="captcha" name="captcha" type="text" autocomplete="false" value="" />
						<img src="./captcha.jpg" id="captchaimg" style="cursor: pointer;" onclick="imgClick(this);" />
					</li>
				</c:if>
				<c:if test="${not empty overideLogin}">
					<li>
						<input name="overideLogin" value="true" tabindex="3" type="checkbox"  style="vertical-align : 0px;"/>
						<label for="overideLogin" style="color: #999999; font: 400 13px / 34px 宋体"> 
							<spring:message code="screen.welcome.label.overideLogin" />
						</label>
					</li>
				</c:if>
        	</div>
			<span>act:15815006577-pwd:000000</span>
	        <div class="button-groups">
	        	<input type="hidden" name="lt" value="${loginTicket}" />
				<input type="hidden" name="execution" value="${flowExecutionKey}" />
				<input type="hidden" name="_eventId" value="submit" />
				<button type="submit" class="login" id="agent_submit" tabindex="4">立即登录</button>
	            <li style="color: red; font-size: 12px; line-height: 2em;margin-bottom: 5px;">
					<form:errors path="*" id="msg" cssClass="errors" element="span" />
				</li>
	            <div class="forgetPwd">
	                <a href="${pageContext.request.contextPath}/findPassword?option=oneOpt&service=${service}">激活账户/忘记登录密码?</a>
	            </div>
	            <input type="hidden" value="${service}" id="service"/>
	            <%--<a href="${pageContext.request.contextPath}/register?service=${service}" class="btn register">注册帐号</a>--%>
				<a href="" class="btn register">帐号注册功能内测中，敬请期待！</a>
	        </div>
        	</form:form>
        	<div class="copyright">广州市学习技术有限公司版权所有-备案/许可证编号为：苏ICP备15035798号</div>
    	</div>
</body>
</html>
<script type="text/javascript">
$(document).ready(function(){
	var service = $('#service').val();
	var words = service.split('?')[1];
	if(words == 'act=reg'){
		window.location.href='${pageContext.request.contextPath}/register?service=' + service;
	}
	
	// 验证码更换图片事件
	$("#captchaimg").click(function(event) {
		this.src = './captcha.jpg?' + (+new Date);
	});
	
	$("#captcha").focusout(function(event) {
		if (!$(this).val()) {
			$(this).val("输入验证码").css({
				color : '#ccc'
			});
		}
	}).focusin(function(event) {
		if ($(this).val() == "输入验证码") {
			$(this).val("");
		}
	});
	$("#username").attr("placeholder","帐号");
	$("#password").attr("placeholder","密码");
	
	$("#fm1").submit(function() {
		var cpa = $("#captcha"), v = cpa.val();
		if (cpa.length && (!v || "请输入验证码" == v)) {
			cpa.val("请输入验证码");
			alert("请输入验证码");
			return false;
		}
	});
	changeFrameDiv();
});

	function imgClick(obj) {
		obj.src = './captcha.jpg?' + (+new Date().getTime());
	}
	function changeFrameDiv(){
		var h = $("#loginRr").height()+2;
		$("#frameDiv").height(h);
	}
</script>